import request from '@/utils/request'
// 文章分类列表
export const cateService_getList = () => {
  return request.get('/my/cate/list')
}

export const cateService_deleteArticle = (id) => {
  return request.delete('/my/cate/del', {
    params: {
      id
    }
  })
}

export const cateService_addArticle = (params) => {
  console.log(params)
  return request.post('/my/cate/add', params)
}

export const cateService_updateArticle = (params) => {
  return request.put('my/cate/info', params)
}

// 获取文章分类详情
export const cateService_getArticleInfo = (id) => {
  return request.get('my/cate/info', {
    params: {
      id
    }
  })
}

/**文章管理接口 */
export const articleServiceList = (params) => {
  console.log(params)
  return request.get('/my/article/list', {
    params
  })
}

export const articleService_deleteArticle = (id) => {
  return request.delete('/my/article/info', {
    params: {
      id
    }
  })
}

export const articleService_addArticle = (params) => {
  return request.post('/my/article/add', params)
}

export const articleService_updateArticle = (params) => {
  return request.put('my/article/info', params)
}

// 获取文章分类详情
export const articleService_getArticleInfo = (id) => {
  return request.get('my/article/info', {
    params: {
      id
    }
  })
}
